package com.myk.game.heroscuffle.signs;

public class CountSign_DongShang extends CountSign {

    private static final int REDUCE_ATK = 10; //减少敌人的攻击力数值
    private static final int REDUCE_DEF = 4; //减少敌人的防御力数值

    public CountSign_DongShang() {
        super("冻伤", 2);
    }

    @Override
    protected void onPaste() {
        int atkDownTo = hostHero.getAtkDownTo();
        if (atkDownTo > REDUCE_ATK) {
            hostHero.atk -= REDUCE_ATK;
            game.ui.printMsg("atk减少" + REDUCE_ATK + "点，");
        }
        else {
            hostHero.atk -= atkDownTo;
            game.ui.printMsg("atk减少" + atkDownTo + "点(已达下限)，");
        }
        if (hostHero.def > REDUCE_DEF) {
            hostHero.def -= REDUCE_DEF;
            game.ui.printMsg("def减少" + REDUCE_DEF + "点。");
        }
        else {
            hostHero.def = 0;
            game.ui.printMsg("def减少至0点。");
        }
        game.ui.sleepShortly();
    }

    @Override
    protected void onRemove() {
        hostHero.atk += REDUCE_ATK;
        game.ui.printMsg("atk恢复至" + hostHero.atk + "点，");
        int defUpTo = hostHero.getDefUpTo();
        hostHero.def += Math.min(defUpTo, REDUCE_DEF);
        game.ui.printMsg("def恢复至" + hostHero.def + "点。");
    }
}
